
//- This Source Code Form is subject to the terms of the Mozilla Public
//- License, v. 2.0. If a copy of the MPL was not distributed with this
//- file, You can obtain one at http://mozilla.org/MPL/2.0/.
//-
//- Copyright (c) 2021-present Kaleidos Ventures SL

tg-lightbox-close

.move-to-sprint-container
  .move-to-sprint-header
    h2.title {{ 'TASKBOARD.MOVE_TO_SPRINT.TITLE_ACTION_MOVE_UNFINISHED'|translate }}

    ul
      li.choice(ng-if="vm.ussCount")
        span(ng-bind-html="'TASKBOARD.MOVE_TO_SPRINT.UNFINISHED_USER_STORIES_COUNT'|translate:{ total: vm.ussCount || 0 }:'messageformat'")
        .check.js-check(ng-if="vm.hasManyItemTypes")
            input(
              type="checkbox"
              ng-checked="vm.typesSelected['uss']"
              ng-model="vm.typesSelected['uss']"
              ng-change="vm.updateSelected('uss', vm.typesSelected['uss'])"
              ng-disabled="!vm.sprints.length"
            )
            div
            span.check-text.check-yes(translate="COMMON.YES")
            span.check-text.check-no(translate="COMMON.NO")

      li.choice(ng-if="vm.tasksCount")
        span(ng-bind-html="'TASKBOARD.MOVE_TO_SPRINT.UNFINISHED_STORYLESS_TASKS_COUNT'|translate:{ total: vm.tasksCount || 0 }:'messageformat'")
        .check.js-check(ng-if="vm.hasManyItemTypes")
            input(
              type="checkbox"
              ng-checked="vm.typesSelected['tasks']"
              ng-model="vm.typesSelected['tasks']"
              ng-change="vm.updateSelected('tasks', vm.typesSelected['tasks'])"
              ng-disabled="!vm.sprints.length"
            )
            div
            span.check-text.check-yes(translate="COMMON.YES")
            span.check-text.check-no(translate="COMMON.NO")

      li.choice(ng-if="vm.issuesCount")
        span(ng-bind-html="'TASKBOARD.MOVE_TO_SPRINT.UNFINISHED_ISSUES_COUNT'|translate:{ total: vm.issuesCount || 0 }:'messageformat'")
        .check.js-check(ng-if="vm.hasManyItemTypes")
            input(
              type="checkbox"
              ng-checked="vm.typesSelected['issues']"
              ng-model="vm.typesSelected['issues']"
              ng-change="vm.updateSelected('issues', vm.typesSelected['issues'])"
              ng-disabled="!vm.sprints.length"
            )
            div
            span.check-text.check-yes(translate="COMMON.YES")
            span.check-text.check-no(translate="COMMON.NO")

  .move-to-sprint-controls
    p(ng-if="!vm.sprints.length") {{ 'TASKBOARD.MOVE_TO_SPRINT.NO_OPEN_SPRINTS'|translate }}
    div(ng-if="vm.sprints.length > 0")
      fieldset
        label {{ 'TASKBOARD.MOVE_TO_SPRINT.MOVE_TO_OPEN_SPRINT'|translate }}
        select.sprint-select(
            ng-model="vm.selectedSprintId"
            ng-options="s.id as s.name for s in vm.sprints"
            id="sprint-selector-dropdown"
            autofocus
        )
            option(
                value=""
                disabled
                selected
                translate="TASKBOARD.MOVE_TO_SPRINT.SELECT_DESTINATION_PLACEHOLDER"
            )
      button.btn-small.move-button(
          variant="primary"
          href=""
          ng-click="vm.submit()"
          translate="COMMON.SAVE"
          ng-disabled="!(vm.selectedSprintId && vm.someSelected)"
      )
